package spring.chatroom.java_chatroom.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import spring.chatroom.java_chatroom.common.handler.WebSocketHandler;
import spring.chatroom.java_chatroom.common.utils.WebSocketSessionManagerUtil;

@RestController
@RequestMapping("hadage")
public class SetInfoController {
    @Autowired
    WebSocketHandler w;

    @RequestMapping("getSessionQueue")
    public String getSessionQueue() {
        return "定时器数组中的数据：" + w.getSessionQueue().toString();
    }

    @RequestMapping("WebsocketSession")
    public String getWebsocketSession() {
        return "在线的WebsocketSession：" + WebSocketSessionManagerUtil.getMap().toString();
    }

    @RequestMapping("list")
    public String getHadage() {
        return "getSessionQueue " + " WebsocketSession";
    }
}
